<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="lib/validform/css/style.css"/>
		<link rel="stylesheet" type="text/css" href="css/register.css"/>
	</head>
	<body>
		<div class="register-logo">
			<img src="./img/register_img/login_03.png" >
		</div>
		<form class="form" action="/api/user/register" method="post">
		<div class="reg-name"><input type="text" name="username" id="" value="" placeholder="请输入用户名" datatype='s3-15' errormsg='账号应为3-15位字符!' /></div>
		<div class="reg-sex"><label for="">性别:</label>
		<input type="radio" name="sex" id="" value="male" datatype='*' checked="checked" /><label>男</label>
		<input type="radio" name="sex" id="" value="female" datatype='*' /><label>女</label>
		</div>
		<div class="reg-pass"><input type="password" name="password" id="" value="" placeholder="密码" datatype='n3-15' errormsg='密码应为3-15位数字!' /></div>
		<div class="reg-repass"><input type="password" name="" id="" value="" placeholder="请再次输入密码" datatype='*' recheck='password' errormsg='两次密码输入不一致!' /></div>
<div class="reg-tel">
	<input type="text" name="tel" id="" value="" placeholder="手机号码" datatype='m' errormsg='请输入正确的手机号码!'/>
	<div>+86▾</div>
</div>
<div class="reg-code">
	<input type="text" name="" id="" value="" placeholder="验证码" />
	<div>获取验证码</div>
</div>
<div class="reg-reg"><button type="submit">注册</button></div>
		</form>
		<script src="./lib/jquery/jquery-3.6.0.min.js"></script>
		<script src="lib/validform/js/Validform_v5.3.2_min.js"></script>
		<script src="lib/layer/layer.js"></script>
		<script type="text/javascript">
			$('.form').Validform({
				tiptype:4,
				ajaxPost:true,
				callback:function(res){
					if(res.status){
						//登录成功
						layer.msg(res.msg);
						//跳转页面
						location.assign('./index.html')
					} else{
						//登陆失败
						layer.msg(res.msg)
					}
				}
			})
		</script>
		
	</body>
</html>
